#!/bib/bash

echo 3 > /proc/sys/vm/drop_caches &>/dev/null

if [ ! -d /opt/dockerimage  ];then
    cd /opt/ ; tar xf dockerimage.tar.gz
fi

input_dir=/opt/dockerimage

docker_images_list=$(ls ${input_dir}|xargs)
for n in $docker_images_list
do
    echo 3 > /proc/sys/vm/drop_caches &>/dev/null
    docker_images_name=$n

    echo $docker_images_name
    docker load  < ${input_dir}/$docker_images_name
done

echo 3 > /proc/sys/vm/drop_caches &>/dev/null
docker images